package com.ltkj.ticket.service.impl;

import java.util.List;
import com.ltkj.common.core.utils.DateUtils;
import com.ltkj.common.security.utils.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ltkj.ticket.mapper.TicTypeMapper;
import com.ltkj.ticket.domain.TicType;
import com.ltkj.ticket.service.ITicTypeService;

/**
 * 票种Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-31
 */
@Service
public class TicTypeServiceImpl implements ITicTypeService 
{
    private static final Logger log = LoggerFactory.getLogger(TicTypeServiceImpl.class);

    @Autowired
    private TicTypeMapper ticTypeMapper;

    /**
     * 查询票种
     * 
     * @param ticTypeId 票种主键
     * @return 票种
     */
    @Override
    public TicType selectTicTypeByTicTypeId(Long ticTypeId)
    {
        return ticTypeMapper.selectTicTypeByTicTypeId(ticTypeId);
    }

    /**
     * 查询票种列表
     * 
     * @param ticType 票种
     * @return 票种
     */
    @Override
    public List<TicType> selectTicTypeList(TicType ticType)
    {
        return ticTypeMapper.selectTicTypeList(ticType);
    }

    /**
     * 新增票种
     * 
     * @param ticType 票种
     * @return 结果
     */
    @Override
    public int insertTicType(TicType ticType)
    {
        ticType.setIsDel("0");
        ticType.setCreateBy(SecurityUtils.getUsername());
        ticType.setCreateTime(DateUtils.getNowDate());
        return ticTypeMapper.insertTicType(ticType);
    }

    /**
     * 修改票种
     * 
     * @param ticType 票种
     * @return 结果
     */
    @Override
    public int updateTicType(TicType ticType)
    {
        ticType.setUpdateTime(DateUtils.getNowDate());
        return ticTypeMapper.updateTicType(ticType);
    }

    /**
     * 批量删除票种
     * 
     * @param ticTypeIds 需要删除的票种主键
     * @return 结果
     */
    @Override
    public int deleteTicTypeByTicTypeIds(Long[] ticTypeIds)
    {
        return ticTypeMapper.deleteTicTypeByTicTypeIds(ticTypeIds);
    }

    /**
     * 删除票种信息
     * 
     * @param ticTypeId 票种主键
     * @return 结果
     */
    @Override
    public int deleteTicTypeByTicTypeId(Long ticTypeId)
    {
        return ticTypeMapper.deleteTicTypeByTicTypeId(ticTypeId);
    }
}
